﻿using System.Collections.Generic;
using Multiprocessing.Core.Units;

namespace Multiprocessing.Core.Algorithm
{
    public interface IAlgorithm
    {
        string Name { get; }

        AlgorithmResult Execute<TProcessingBlock>(params object[] args)
            where TProcessingBlock : IProcessingBlock;

        AlgorithmResult Execute<TProcessingBlock>(int processingUnitCount, params object[] args)
            where TProcessingBlock : IProcessingBlock;

        object[] CreateParameters(int size);
        
        AlgorithmResult Execute(IProcessingBlock processingBlock, params object[] args);
    }

    public interface IAlgorithm<T> : IAlgorithm
    {
        new AlgorithmResult<T> Execute<TProcessingBlock>(params object[] args)
            where TProcessingBlock : IProcessingBlock;

        new AlgorithmResult<T> Execute<TProcessingBlock>(int processingUnitCount, params object[] args)
            where TProcessingBlock : IProcessingBlock;

        new AlgorithmResult<T> Execute(IProcessingBlock processingBlock, params object[] args);
    }
}
